import { matchRoutes } from 'umi';
 
export function onRouteChange({ clientRoutes, location }) {
  //clientRoutes 和当前匹配的路由配置项
  //location 当前匹配的location对象
  const route = matchRoutes(clientRoutes, location.pathname)?.pop()?.route;
  
  if (route.title) {
    document.title = route.title || '';
  }
}